// API配置文件
export const API_CONFIG = {
  // MediaMTX服务器地址
  BASE_URL: 'http://localhost:9997',
  // 录像下载服务地址
  RECORDINGS_BASE_URL: 'http://localhost:9996',

  // API端点
  ENDPOINTS: {
    PATHS_LIST: '/v3/paths/list',
    RECORDINGS_GET: '/v3/recordings/get',
    RECORDINGS_LIST: '/list',
    RECORDINGS_DOWNLOAD: '/get'
  },

  // 请求配置
  REQUEST_CONFIG: {
    TIMEOUT: 10000, // 10秒超时
    RETRY_COUNT: 3, // 重试次数
    RETRY_DELAY: 1000 // 重试延迟(ms)
  },

  // 分页配置
  PAGINATION: {
    DEFAULT_PAGE_SIZE: 100,
    MAX_PAGE_SIZE: 1000
  }
}

// 环境配置
export const ENV_CONFIG = {
  // 开发环境
  development: {
    API_BASE_URL: 'http://localhost:9997',
    STREAM_URL: 'http://localhost:8888',
    WEBRTC_URL: 'http://localhost:8889',
    RECORDINGS_URL: 'http://localhost:9996',
    ENABLE_MOCK: false
  },

  // 生产环境
  production: {
    API_BASE_URL: 'http://localhost:9997',
    STREAM_URL: 'http://localhost:8888',
    WEBRTC_URL: 'http://localhost:8889',
    RECORDINGS_URL: 'http://localhost:9996',
    ENABLE_MOCK: false
  }
}

// 获取当前环境的API配置
export const getApiConfig = () => {
  const env = import.meta.env.MODE || 'development'
  return ENV_CONFIG[env as keyof typeof ENV_CONFIG]
}
